<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>学生信息管理</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #CE858E;
            margin: 0;
            padding: 20px;
        }
        .module {
            background-color: #AC3743;
            color: white;
            padding: 20px;
            margin-bottom: 20px;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
        }
        .module:hover {
            transform: scale(1.02);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
        }
        h1, h2 {
            margin-top: 0;
        }
        input, button {
            margin-right: 10px;
            margin-bottom: 10px;
        }
        ul {
            list-style-type: none;
            padding: 0;
        }
        li {
            padding: 5px;
            border-radius: 4px;
            background-color: rgba(255, 255, 255, 0.1);
            margin-bottom: 5px;
        }
    </style>
</head>
<body>

 <div class="module" >
        <h2>学生信息列表</h2>
        <ul id="studentsList"></ul>
    </div>

    <div class="module" id="add">
    <h2>添加学生信息</h2>
    <form action="{{ url_for('add_student') }}" method="post">
        <input type="text" id="name" name="name" placeholder="姓名" required>
        <select id="gender" name="gender">
            <option value="男">男</option>
            <option value="女">女</option>
        </select>
        <input type="text" id="age" name="age" placeholder="年龄" required>
        <input type="text" id="class" name="class" placeholder="班级" required>
        <input type="text" id="id" name="id" placeholder="学号" required>
        <input type="text" id="dormitory_number" placeholder="宿舍号" name="dormitory_number">
        <button type="submit">添加</button>
    </form>
</div>

    <div class="module">
        <h2>查询学生信息</h2>
        <form action="{{ url_for('search') }}" method="post">
            <input type="text" placeholder="姓名或学号、宿舍号" name="id" required>
            <button>查询</button>
        </form>
    </div>


      <div class="module" id="update" >
        <h2>修改学生信息</h2>
          <form action="{{ url_for('update') }}" method="post" required>
            <input type="text"  name="updateId" placeholder="学号" required>
            <input type="text"  name="newName" placeholder="新姓名" required>
            <select id="newGender" name="newGender" required>
                <option value="男">男</option>
                <option value="女">女</option>
            </select>
            <input type="text"  placeholder="新年龄" name="newAge" required>
            <input type="text"  placeholder="新班级" name="newClass" required>
            <input type="text"  placeholder="新宿舍号" name="newDormitory_number" required>

            <button>修改</button>
          </form>
    </div>


    <!-- 删除学生信息模块 -->
<div class="module" id="delete">
    <h2>删除学生信息</h2>
    <form action="/delete" method="post">
        <input type="text"  placeholder="学号" name="deleteId" required>
        <button>删除</button>
    </form>
</div>

</body>
</html>

